package com.hxgis.common.enums;

import lombok.Getter;

import java.util.Objects;

/**
 * @author cqj
 * @version 1.0
 * @date 2019/10/28 15:11
 */
@Getter
public enum RainFlagEnum {

    RAINFALL20("20","rainFall"),
    RAINFALL08("08","rainFall08")
    ;

    private String flag;

    private String message;


    RainFlagEnum(String flag, String message) {
        this.flag = flag;
        this.message = message;
    }


    public static RainFlagEnum getRainFlagEnum(String flag) {
        RainFlagEnum[] values = RainFlagEnum.values();
        for (RainFlagEnum value : values) {
            if (Objects.equals(value.getFlag(),flag)){
                return value;
            }
        }
        return null;
    }

    public static void main(String[] args) {
        RainFlagEnum rainFlagEnum = getRainFlagEnum("08");
        System.out.println(rainFlagEnum.getMessage());
    }



}
